Conversation
Allow channelwise convolution prefuse pass to match half_type in addition to float_type.
There was a problem hiding this comment.
Pull request overview
Extends the GPU channelwise-convolution prefuse pattern so FP16 (half) convolutions can be recognized and rewritten to gpu::channelwise_conv, matching the existing FP32 behavior.
Changes:
- Allow
find_channelwise_convolutioningpu::prefuse_opsto matchshape::half_typeinputs in addition toshape::float_type.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| if(input->get_shape().type() != shape::float_type and | ||
| input->get_shape().type() != shape::half_type) |
There was a problem hiding this comment.
This condition calls input->get_shape().type() twice and hard-codes two comparisons. For readability and to avoid repeating work, consider caching the type in a local (e.g., auto t = …) and checking membership (e.g., via contains({shape::float_type, shape::half_type}, t)) as done in other GPU type gates (e.g., src/targets/gpu/lowering.cpp:349).
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #4808 +/- ##
===========================================
+ Coverage 92.46% 92.52% +0.05%
===========================================
Files 583 583
Lines 29551 29967 +416
===========================================
+ Hits 27323 27724 +401
- Misses 2228 2243 +15 🚀 New features to boost your workflow:
|
Check flagged results 🔆 * No develop baseline was found for this PR's branch point; compared against the latest available develop run instead. |
|
|
On Navi48, fp16 is sometimes slower:
|
ef2fc84 to
85b943f
Compare
Allow channelwise convolution prefuse pass to match half_type in addition to float_type. For small shape(CWH < 48k), still use mlir_conv.
Motivation
Extend the channelwise convolution prefuse pass to match half_type in addition to float_type.
Technical Details
Allow the channelwise convolution prefuse pass to recognize half_type.
Changelog Category
Add a
CHANGELOG.mdentry for any option other thanNot Applicable